| Conditions | 2 |
| Total Lines | 26 |
| Code Lines | 24 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | import { |
||
| 28 | |||
| 29 | @Put(':id') |
||
| 30 | @ApiOperation({title: 'Update event'}) |
||
| 31 | public async index( |
||
| 32 | @Param() idDto: EventIdDTO, |
||
| 33 | @Body() dto: EventDTO, |
||
| 34 | @LoggedUser() user: User |
||
| 35 | ) { |
||
| 36 | const {type, time, summary, projectId, taskId} = dto; |
||
| 37 | |||
| 38 | try { |
||
| 39 | const id = await this.commandBus.execute( |
||
| 40 | new UpdateEventCommand( |
||
| 41 | idDto.id, |
||
| 42 | user, |
||
| 43 | type, |
||
| 44 | Number(time), |
||
| 45 | projectId, |
||
| 46 | taskId, |
||
| 47 | summary |
||
| 48 | ) |
||
| 49 | ); |
||
| 50 | |||
| 51 | return {id}; |
||
| 52 | } catch (e) { |
||
| 53 | throw new BadRequestException(e.message); |
||
| 54 | } |
||
| 57 |